import java.util.ArrayList;

public class ArrayListTest02 {
    public static void main(String[] args) {

        ArrayList<Student> array = new ArrayList<>();

        Student s1 = new Student("张三", 16); Student s2 = new Student("李四", 17); Student s3 = new Student("王麻子", 18);

        for (int i = 0; i < array.size(); i++) {
            Student s = array.get(i);
            System.out.println(s.getName() + "," + s.getAge());
        }
    }
}